package com.jiwanqing.demo.service.impl;

import com.jiwanqing.demo.entity.Student;
import com.jiwanqing.demo.entity.Teacher;
import com.jiwanqing.demo.mapper.IStudentMapper;
import com.jiwanqing.demo.mapper.impl.StudentMapperImpl;
import com.jiwanqing.demo.service.IStudentService;

import java.util.List;

public class StudentServiceImpl implements IStudentService {
    private IStudentMapper iStudentMapper = new StudentMapperImpl();

    @Override
    public Student scoreRating(Student s) {
        System.out.println("service:老师开始评级");
        Teacher teacher = new Teacher();
        Student newStudent = teacher.scoreRating(s);
        System.out.println("service:评级完成，交给教务");
        return iStudentMapper.save(s);
    }

    @Override
    public List<Student> queryStudentInfoAll() {
        return iStudentMapper.selectAll();
    }

    @Override
    public int addStudent(Student student) {
        return iStudentMapper.insert(student);
    }


}
